Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: minor cleanup to simulation docs #21777

Merged
merged 4 commits into from
Sep 18, 2024
Merged

docs: minor cleanup to simulation docs #21777

merged 4 commits into from
Sep 18, 2024

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented Sep 17, 2024

Description

this pr does a minor cleanup of docs around the simulator


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Introduced the FuzzFullAppSimulation command for enhanced testing using the Go fuzzer.
    • Added a reference to the Bank module example for store decoders.
  • Documentation

    • Updated references and streamlined instructions for implementing simulation functions and governance proposals in the Cosmos SDK.
    • Enhanced clarity and readability in various documentation sections, including the simsx package README.
  • Bug Fixes

    • Improved accuracy of links and instructions related to simulation operations and package parameters.
    • Updated documentation to reflect the latest changes in the Cosmos SDK simulation framework.

@tac0turtle tac0turtle requested a review from a team as a code owner September 17, 2024 10:49
Copy link
Contributor

coderabbitai bot commented Sep 17, 2024

Walkthrough

Walkthrough

The changes in this pull request enhance the documentation and functionality related to implementing store decoders and simulation functions within the Cosmos SDK. Key updates include new references for modules, streamlined instructions for overriding package parameters, clarifications on governance proposals, and modifications to the store decoder registration method. Additionally, a new command for fuzz testing in simulations has been introduced, and various references have been updated to ensure alignment with the latest codebase.

Changes

Files Change Summary
docs/build/building-modules/14-simulator.md Enhanced guidance on store decoders, updated references for weights, governance messages, and deterministic behavior integration.
docs/learn/advanced/12-simulation.md Updated references, streamlined text, clarified simulation commands, and introduced FuzzFullAppSimulation.
simsx/README.md Restructured section headers for improved readability without content changes.
x/distribution/module.go Modified RegisterStoreDecoder method to use NewStoreDecoderFuncFromCollectionsSchema.
x/distribution/simulation/decoder.go Removed NewDecodeStore function for decoding KV pairs related to distribution types.
x/distribution/simulation/decoder_test.go Removed test suite TestDecodeDistributionStore for validating decoding operations.

Possibly related PRs

  • feat(runtime/v2): store loader on simappv2 #21704: The changes in this PR introduce a StoreLoader functionality that enhances the management of store upgrades, which is relevant to the main PR's updates on simulation functions and governance proposals in the Cosmos SDK.
  • test: fix sims #21735: This PR addresses simulation failures, which may relate to the simulation functions discussed in the main PR, as both aim to improve the reliability and functionality of simulations within the Cosmos SDK.

Suggested labels

Type: ADR

Suggested reviewers

  • sontrinh16
  • kocubinski
  • facundomedica
  • tac0turtle

Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 04db3be and 1120b96.

Files selected for processing (1)
  • docs/learn/advanced/12-simulation.md (2 hunks)
Additional context used
Path-based instructions (1)
docs/learn/advanced/12-simulation.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

LanguageTool
docs/learn/advanced/12-simulation.md

[style] ~16-~16: The expression “come in handy” is rather colloquial. Consider replacing it to add a more formal tone to your writing.
Context: ... the chain that's being simulated. This comes in handy when trying to reproduce bugs that were...

(COME_IN_HANDY)


[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...erent failure type: * AppImportExport: The simulator exports the initial app s...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~23-~23: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... simulator exports the initial app state and then it creates a new app with the expo...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~24-~24: Loose punctuation mark.
Context: ...the stores. * AppSimulationAfterImport: Queues two simulations together. The fi...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~25-~25: Loose punctuation mark.
Context: ...om a live chain. * AppStateDeterminism: Checks that all the nodes return the sa...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~26-~26: Loose punctuation mark.
Context: ... the same order. * BenchmarkInvariants: Analysis of the performance of running ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~27-~27: Loose punctuation mark.
Context: ...al supply tracker. * FullAppSimulation: General simulation mode. Runs the chain...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~27-~27: The contraction ‘there’re’ is uncommon in written English.
Context: ...or a given number of blocks. Tests that there're no panics on the simulation. It does ...

(THERE_RE_CONTRACTION_UNCOMMON)


[uncategorized] ~28-~28: Loose punctuation mark.
Context: ...t benchmarked. * FuzzFullAppSimulation: Runs general simulation mode with the [...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~29-~29: Loose punctuation mark.
Context: ... to find panics. * AppStateDeterminism: Runs a few seeds many times to test tha...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~41-~41: Possible missing comma found.
Context: ...itial state is pseudo-randomly generated but the module and simulation parameters ca...

(AI_HYDRA_LEO_MISSING_COMMA)

Additional comments not posted (5)
docs/learn/advanced/12-simulation.md (5)

10-10: LGTM!

Updating the link to the latest commit ensures that users access the most up-to-date documentation for the simulation package.


14-14: LGTM!

Removing the unnecessary line break enhances the readability of the paragraph without altering its meaning.


16-16: LGTM!

The paragraph effectively explains the main difference between the simulator app and integration testing.

While the static analysis tool flagged "comes in handy" as colloquial, it is still a widely understood expression in this context and does not significantly detract from the technical nature of the document. Replacing it is a matter of stylistic preference.

Tools
LanguageTool

[style] ~16-~16: The expression “come in handy” is rather colloquial. Consider replacing it to add a more formal tone to your writing.
Context: ... the chain that's being simulated. This comes in handy when trying to reproduce bugs that were...

(COME_IN_HANDY)


23-29: Excellent update to the simulation commands section!

The updated commands and their descriptions improve the clarity and comprehensiveness of the documentation. The addition of the FuzzFullAppSimulation command is particularly valuable, as it highlights the use of the Go fuzzer for detecting panics during simulations.

The static analysis tool flagged some loose punctuation marks in this section, but these are false positives due to the markdown list format and can be safely ignored.

Tools
LanguageTool

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...erent failure type: * AppImportExport: The simulator exports the initial app s...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~23-~23: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... simulator exports the initial app state and then it creates a new app with the expo...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~24-~24: Loose punctuation mark.
Context: ...the stores. * AppSimulationAfterImport: Queues two simulations together. The fi...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~25-~25: Loose punctuation mark.
Context: ...om a live chain. * AppStateDeterminism: Checks that all the nodes return the sa...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~26-~26: Loose punctuation mark.
Context: ... the same order. * BenchmarkInvariants: Analysis of the performance of running ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~27-~27: Loose punctuation mark.
Context: ...al supply tracker. * FullAppSimulation: General simulation mode. Runs the chain...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~27-~27: The contraction ‘there’re’ is uncommon in written English.
Context: ...or a given number of blocks. Tests that there're no panics on the simulation. It does ...

(THERE_RE_CONTRACTION_UNCOMMON)


[uncategorized] ~28-~28: Loose punctuation mark.
Context: ...t benchmarked. * FuzzFullAppSimulation: Runs general simulation mode with the [...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~29-~29: Loose punctuation mark.
Context: ... to find panics. * AppStateDeterminism: Runs a few seeds many times to test tha...

(UNLIKELY_OPENING_PUNCTUATION)


39-44: Reformatting enhances clarity, but please address the outstanding agreement error.

The reformatting of the simulation modes section enhances its clarity, and the added tip effectively communicates that the modes are not mutually exclusive.

The static analysis tool flagged a potential missing comma in this section, but it is a false positive and can be safely ignored.

However, the previously flagged agreement error in the sentence "The list of available parameters are listed here" has not been addressed. Please correct the sentence as follows:

-The list of available parameters are listed [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation/client/cli/flags.go#L59-L78).
+The list of available parameters is listed [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation/client/cli/flags.go#L59-L78).
Tools
LanguageTool

[uncategorized] ~41-~41: Possible missing comma found.
Context: ...itial state is pseudo-randomly generated but the module and simulation parameters ca...

(AI_HYDRA_LEO_MISSING_COMMA)


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai generate interesting stats about this repository and render them as a table.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range and nitpick comments (3)
types/simulation/collections.go (1)

Line range hint 49-51: Consider returning an error instead of panicking for unexpected keys.

Instead of using panic when an unexpected key is encountered, consider returning an error. This would improve error handling and prevent potential crashes in case of unexpected keys.

-		panic(fmt.Errorf("unexpected key %X (%s)", kvA.Key, kvA.Key))
+		return "", fmt.Errorf("unexpected key %X (%s)", kvA.Key, kvA.Key)
docs/learn/advanced/12-simulation.md (2)

16-16: Consider replacing the colloquial expression.

The expression "come in handy" is rather colloquial. Consider replacing it with a more formal alternative to improve the tone of the documentation.

For example, you could rephrase the sentence as follows:

-This comes in handy when trying to reproduce bugs that were generated in the provided operations (randomized or not).
+This is particularly useful when attempting to reproduce bugs that were generated in the provided operations (randomized or not).
Tools
LanguageTool

[style] ~16-~16: The expression “come in handy” is rather colloquial. Consider replacing it to add a more formal tone to your writing.
Context: ... the chain that's being simulated. This comes in handy when trying to reproduce bugs that were...

(COME_IN_HANDY)


23-29: LGTM, but consider replacing the uncommon contraction.

The addition of the FuzzFullAppSimulation command enhances the documentation by highlighting an additional functionality for improved testing.

However, the contraction "there're" is uncommon in written English. Consider replacing it with a more formal alternative to improve the tone of the documentation.

For example, you could rephrase the sentence as follows:

-Tests that there're no `panics` on the simulation.
+Tests that there are no `panics` during the simulation.

Note: The loose punctuation marks flagged by the static analysis tool are intentional as they are part of a list format in markdown.

Tools
LanguageTool

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...erent failure type: * AppImportExport: The simulator exports the initial app s...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~23-~23: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... simulator exports the initial app state and then it creates a new app with the expo...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~24-~24: Loose punctuation mark.
Context: ...the stores. * AppSimulationAfterImport: Queues two simulations together. The fi...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~25-~25: Loose punctuation mark.
Context: ...om a live chain. * AppStateDeterminism: Checks that all the nodes return the sa...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~26-~26: Loose punctuation mark.
Context: ... the same order. * BenchmarkInvariants: Analysis of the performance of running ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~27-~27: Loose punctuation mark.
Context: ...al supply tracker. * FullAppSimulation: General simulation mode. Runs the chain...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~27-~27: The contraction ‘there’re’ is uncommon in written English.
Context: ...or a given number of blocks. Tests that there're no panics on the simulation. It does ...

(THERE_RE_CONTRACTION_UNCOMMON)


[uncategorized] ~28-~28: Loose punctuation mark.
Context: ...t benchmarked. * FuzzFullAppSimulation: Runs general simulation mode with the [...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~29-~29: Loose punctuation mark.
Context: ... to find panics. * AppStateDeterminism: Runs a few seeds many times to test tha...

(UNLIKELY_OPENING_PUNCTUATION)

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 081b90e and e08f5da.

Files selected for processing (4)
  • docs/build/building-modules/14-simulator.md (3 hunks)
  • docs/learn/advanced/12-simulation.md (2 hunks)
  • simsx/README.md (2 hunks)
  • types/simulation/collections.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • simsx/README.md
Additional context used
Path-based instructions (3)
types/simulation/collections.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

docs/learn/advanced/12-simulation.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

docs/build/building-modules/14-simulator.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

LanguageTool
docs/learn/advanced/12-simulation.md

[style] ~16-~16: The expression “come in handy” is rather colloquial. Consider replacing it to add a more formal tone to your writing.
Context: ... the chain that's being simulated. This comes in handy when trying to reproduce bugs that were...

(COME_IN_HANDY)


[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...erent failure type: * AppImportExport: The simulator exports the initial app s...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~23-~23: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... simulator exports the initial app state and then it creates a new app with the expo...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~24-~24: Loose punctuation mark.
Context: ...the stores. * AppSimulationAfterImport: Queues two simulations together. The fi...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~25-~25: Loose punctuation mark.
Context: ...om a live chain. * AppStateDeterminism: Checks that all the nodes return the sa...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~26-~26: Loose punctuation mark.
Context: ... the same order. * BenchmarkInvariants: Analysis of the performance of running ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~27-~27: Loose punctuation mark.
Context: ...al supply tracker. * FullAppSimulation: General simulation mode. Runs the chain...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~27-~27: The contraction ‘there’re’ is uncommon in written English.
Context: ...or a given number of blocks. Tests that there're no panics on the simulation. It does ...

(THERE_RE_CONTRACTION_UNCOMMON)


[uncategorized] ~28-~28: Loose punctuation mark.
Context: ...t benchmarked. * FuzzFullAppSimulation: Runs general simulation mode with the [...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~29-~29: Loose punctuation mark.
Context: ... to find panics. * AppStateDeterminism: Runs a few seeds many times to test tha...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~41-~41: Possible agreement error.
Context: ...lated. The list of available parameters are listed [here](https://github.com/cosmos...

(AGREEMENT_SENT_START)

docs/build/building-modules/14-simulator.md

[uncategorized] ~71-~71: The preposition ‘to’ seems more likely in this position.
Context: ...tions can be executed like normal tests in Go from the shell or within an IDE. Mak...

(AI_HYDRA_LEO_REPLACE_IN_TO)

Additional comments not posted (9)
types/simulation/collections.go (1)

Line range hint 13-54: LGTM! The function implementation aligns with the PR objectives.

The NewStoreDecoderFuncFromCollectionsSchema function provides a convenient way to decode key-value pairs based on the module's collections schema. It ensures that the key-value pairs have matching prefixes and uses the appropriate value codec for decoding.

The function implementation adheres to the Uber Go Style Guide, with clear variable names, proper error handling, and concise code structure.

docs/learn/advanced/12-simulation.md (2)

10-10: LGTM!

Updating the link to the latest commit ensures that users access the most up-to-date documentation.


14-14: LGTM!

Removing unnecessary line breaks enhances readability without altering the content's meaning.

docs/build/building-modules/14-simulator.md (6)

41-42: Excellent addition of the Bank module example for store decoders.

The reference to the Bank module example provides valuable guidance for modules utilizing the collections package. This addition enhances the documentation by offering a concrete implementation for developers to refer to.


66-66: Good update to the reference for setting weights in simulations.

The updated reference points to a more current and relevant code example for defining weights. This change ensures that the documentation is in sync with the latest codebase, providing accurate guidance to developers.


74-76: Appropriate update to the reference for overriding package parameters.

The updated reference directs users to the current location of the relevant code for overriding package simappparams. This change ensures that the documentation accurately reflects the latest codebase structure, improving clarity for developers.


81-85: Excellent update to the reference and clarification for registering governance proposal messages.

The updated reference points users to the current location of the relevant code for registering governance proposal messages. Additionally, the clarification that modules must register messages for governance proposals emphasizes this important requirement. These changes ensure that the documentation is accurate, up-to-date, and provides clear instructions for developers.


92-92: Appropriate update to the reference for integrating simulation functions into the module pattern.

The updated reference directs users to the current location of the relevant code for integrating simulation functions. This change ensures that the documentation accurately reflects the latest codebase structure, providing developers with the most up-to-date information.


138-138: Good update to the reference for deterministic behavior integration.

The updated reference points users to the current location of the relevant code for integrating deterministic behavior. This change ensures that the documentation is in sync with the latest codebase, providing accurate guidance to developers.

Comment on lines 39 to 44
1. Completely random where the initial state, module parameters and simulation parameters are **pseudo-randomly generated**.
2. From a `genesis.json` file where the initial state and the module parameters are defined. This mode is helpful for running simulations on a known state such as a live network export where a new (mostly likely breaking) version of the application needs to be tested.
3. From a `params.json` file where the initial state is pseudo-randomly generated but the module and simulation parameters can be provided manually. This allows for a more controlled and deterministic simulation setup while allowing the state space to still be pseudo-randomly simulated. The list of available parameters are listed [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation/client/cli/flags.go#L59-L78).

:::tip
These modes are not mutually exclusive. So you can for example run a randomly
generated genesis state (`1`) with manually generated simulation params (`3`).
These modes are not mutually exclusive. So you can for example run a randomly generated genesis state (`1`) with manually generated simulation params (`3`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please correct the agreement error.

Reformatting the modes of simulation enhances clarity and emphasizes that they are not mutually exclusive.

However, there is an agreement error in the sentence "The list of available parameters are listed here." The subject "list" is singular, so the verb should be "is" instead of "are."

Please correct the sentence as follows:

-The list of available parameters are listed [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation/client/cli/flags.go#L59-L78).
+The list of available parameters is listed [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation/client/cli/flags.go#L59-L78).
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Completely random where the initial state, module parameters and simulation parameters are **pseudo-randomly generated**.
2. From a `genesis.json` file where the initial state and the module parameters are defined. This mode is helpful for running simulations on a known state such as a live network export where a new (mostly likely breaking) version of the application needs to be tested.
3. From a `params.json` file where the initial state is pseudo-randomly generated but the module and simulation parameters can be provided manually. This allows for a more controlled and deterministic simulation setup while allowing the state space to still be pseudo-randomly simulated. The list of available parameters are listed [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation/client/cli/flags.go#L59-L78).
:::tip
These modes are not mutually exclusive. So you can for example run a randomly
generated genesis state (`1`) with manually generated simulation params (`3`).
These modes are not mutually exclusive. So you can for example run a randomly generated genesis state (`1`) with manually generated simulation params (`3`).
1. Completely random where the initial state, module parameters and simulation parameters are **pseudo-randomly generated**.
2. From a `genesis.json` file where the initial state and the module parameters are defined. This mode is helpful for running simulations on a known state such as a live network export where a new (mostly likely breaking) version of the application needs to be tested.
3. From a `params.json` file where the initial state is pseudo-randomly generated but the module and simulation parameters can be provided manually. This allows for a more controlled and deterministic simulation setup while allowing the state space to still be pseudo-randomly simulated. The list of available parameters is listed [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/simulation/client/cli/flags.go#L59-L78).
:::tip
These modes are not mutually exclusive. So you can for example run a randomly generated genesis state (`1`) with manually generated simulation params (`3`).
Tools
LanguageTool

[grammar] ~41-~41: Possible agreement error.
Context: ...lated. The list of available parameters are listed [here](https://github.com/cosmos...

(AGREEMENT_SENT_START)

@github-actions github-actions bot added C:x/distribution distribution module related C:Simulations labels Sep 17, 2024
@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Sep 17, 2024
@github-actions github-actions bot removed C:x/distribution distribution module related C:Simulations labels Sep 17, 2024
docs/learn/advanced/12-simulation.md Outdated Show resolved Hide resolved
Co-authored-by: Julián Toledano <JulianToledano@users.noreply.github.com>
@tac0turtle tac0turtle added this pull request to the merge queue Sep 18, 2024
Merged via the queue into main with commit 870cab5 Sep 18, 2024
76 checks passed
@tac0turtle tac0turtle deleted the marko/simulationdocs branch September 18, 2024 09:38
mergify bot pushed a commit that referenced this pull request Sep 18, 2024
Co-authored-by: Julián Toledano <JulianToledano@users.noreply.github.com>
(cherry picked from commit 870cab5)
julienrbrt pushed a commit that referenced this pull request Sep 18, 2024
Co-authored-by: Marko <marko@baricevic.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release C:Simulations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants